home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Misc. Utilities / Installer / Installer 3.2 / Samples - Installer 3.2 / SimpleEasyNCustom.r < prev    next >
Encoding:
Text File  |  1992-01-22  |  6.2 KB  |  169 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: simple installation (Supports Easy and Custom Installation)
  6.  *
  7.  *    File:        SimpleEasyNCustom.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *
  11.  *    Copyright © 1991 Apple Computer, Inc.
  12.  *    All rights reserved.
  13.  *
  14.  *------------------------------------------------------------------------------
  15.  *
  16.  * Install application "TheProgram" into the folder "Root":Installed Application.
  17.  * It demonstrates both Easy and Custom Installation.  For the Easy Installation
  18.  * it checks the amount of target system memory and will not do the installation
  19.  * if there is less than 1mb. 
  20.  *----------------------------------------------------------------------------*/
  21.  
  22. #include "Types.r"                    /* for the ICON resource */
  23. #include "InstallerTypes.r"
  24.  
  25. /* You can build and complete the script with the following lines:
  26. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  27. # or set up folders with the same names and contents as the floppies
  28. # put these folders in the same folder as the script or at the root directory of same disk
  29.  
  30.     rez -o "SimpleEasyNCustom" -t 'bjbc' -c 'bjbc' "SimpleEasyNCustom.r"
  31.     setfile -a i "SimpleEasyNCustom"        #mark Inited
  32.     scriptcheck -p "SimpleEasyNCustom"
  33. */
  34.  
  35. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  36. #define kScriptCheckSetsDate    0x01
  37. #define kMinMemMB                01    /* memory needed to install (UPDATE Error Message if changed!)*/
  38.  
  39. /* Definitions for the rules */
  40. #define rlCheckMemSize            1000
  41. #define rlOutputMemSizeError    1001
  42.  
  43. /* Defines for the file spec atoms (specifications for source and destination files) */
  44. #define fsSourceProgram            2000
  45. #define fsTargetProgram            2001
  46.  
  47. /* This is the name of the source disk */
  48. #define ProgramDisk "Program Disk:"
  49.  
  50. /* where we want to install our file. */
  51. #define TargetPath    ":Installed Application:"
  52.  
  53. /* Definition for the package. */
  54. #define pkTheProgram            3000
  55.  
  56. /* Definition for the file atom */
  57. #define faProgram                4000
  58.  
  59. /* Definition for the package comment resource */
  60. #define cmtTheProgram            5000
  61.  
  62. /* October 10, 1990 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  63. /* this value to a LongInt seconds value needed by the Installer. */
  64. #define currentReleaseDate        10101990        
  65. #define currentVersion            100     /* Version 1.0 goes in the 'icmt' rsrc */
  66.  
  67. #define iconTheProgram            5100
  68.  
  69. /************************** Easy Install Rule resources **********************************/
  70. resource 'infr' (1) {
  71.     format0  {{
  72.         pickFirst,    {rlCheckMemSize, rlOutputMemSizeError},     /* Select only one of these rules */
  73.     }};
  74. };
  75.  
  76. resource 'inrl' (rlCheckMemSize) {
  77.     format0 {{
  78.         /* If the system has at least kMinMemMB megs of memory, then add the package */
  79.         checkMinMemory {kMinMemMB},
  80.         addUserDescription {"The Program\n"},    /* message to appear in Easy Install screen */
  81.         addPackages {{pkTheProgram}}            /* we're installing the program */
  82.     }};
  83. };
  84.  
  85. resource 'inrl' (rlOutputMemSizeError) {
  86.     format0 {{
  87.         /* This error message will be displayed on the Easy Install screen if this rule */
  88.         /* fires.  It fires if the first rule in this pickFirst group does not fire */
  89.         
  90.         reportSysError {"To do installation you need:\n\n"},
  91.         reportSysError {"• At least 1 megabyte of memory\n"}    /*if kMinMemMB changes FIX HERE! */
  92.     }};
  93. };
  94.  
  95. /***************************** Package Resources ************************************************/
  96. resource 'inpk' (pkTheProgram) {
  97.     format0 {
  98.         showsOnCustom,                 /* Package appears in the Custom Install display */
  99.         removable,                    /* Package can be removed */
  100.         dontForceRestart,            /* no need to reboot after live install */
  101.         cmtTheProgram,                 /* package's 'icmt' resource id */
  102.         0,                            /* Package size (filled in by ScriptCheck) */
  103.         "TheProgram", {                /* package name for package that shows on custom */
  104.             'infa', faProgram;
  105.         }
  106.     }
  107. };
  108.  
  109. /***************************** Comments ************************************************/
  110. resource 'icmt' (cmtTheProgram) {
  111.     currentReleaseDate,
  112.     currentVersion,
  113.     iconTheProgram,
  114.     "This package contains TheProgram. "
  115. };
  116.  
  117. resource 'ICON' (iconTheProgram) {
  118.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  119.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  120.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  121.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  122.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  123.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  124.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  125.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  126. };
  127.  
  128.  
  129. /********************************************* File Specs ******************************************/
  130. /* Source File Specs */
  131. resource 'infs' (fsSourceProgram) {
  132.     'APPL',                                /* File Type */
  133.     'Arfz',                                /* Creator */
  134.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  135.     noSearchForFile,                    /* Do not search the source disk for the file */
  136.     typeCrMustMatch,                    /* file type and creator on source disk must match */
  137.     ProgramDisk"TheProgram"                /* Path to the file */
  138. };
  139.  
  140. /* Target File Specs */
  141. resource 'infs' (fsTargetProgram) {
  142.     'APPL',                                /* File Type */
  143.     'Arfz',                                /* Creator */
  144.     0,                                    /* creation date not needed for target file specs */
  145.     noSearchForFile,                    /* Do not search the target disk for the file */
  146.     TypeCrMustMatch,                    /* not needed for target file specs */
  147.     TargetPath"TheProgram"                /* destination Path */
  148. };
  149.  
  150. /******************************************** File Atoms ************************************************/
  151. resource 'infa' (faProgram) {
  152.     format0 {
  153.         deleteWhenRemoving,                /* Delete the file if remove (option-custom) is clicked    */
  154.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  155.         copy,                             /* Copy the file to the destination */
  156.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  157.         updateExisting,                 /* replace an existing copy, if mine is newer */
  158.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  159.         rsrcFork, dataFork,                /* Copy both forks of the file */
  160.         fsTargetProgram,                /* TARGET file spec for this file */
  161.         fsSourceProgram,                 /* SOURCE file spec for this file */
  162.         0,                                /* atom size (filled in by ScriptCheck) */
  163.         ""                                /* Atom Description (Installer will use file name) */
  164.     };
  165. };
  166.  
  167.  
  168.  
  169.